package com.ccb.sc.common.modules.member.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @since 2020-09-15
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum MemberPointsLogType implements IEnum<Integer> {

    /**
     * 变动类型
     */
    EXCHANGE_ORDER(1, "直播订单转换"),
    SIGN_IN(2, "每日签到"),
    SHARE(3, "分享"),
    LIVE_PREVIEW(4, "观看直播预告"),
    RAIDERS_DOCUMENT(5, "浏览攻略文档"),
    RESERVE(6, "预约直播商品"),
    EXCHANGE_GOODS(7, "商城兑换"),
    JOIN_GROUP(8, "加入会员群送福利"),

    DIRECT_SUBORDINATE_EXCHANGE_ORDER(9, "直接下级订单转换"),

    INDIRECT_SUBORDINATE_EXCHANGE_ORDER(10, "间接下级订单转换"),

    REWARD_SEVEN_DAYS(11, "累计7天签到"),
    REWARD_SEVENTEEN_DAYS(12, "累计17天签到"),
    REWARD_TWENTY_SEVEN_DAYS(13, "累计27天签到"),

    ORDER_RETURN_POINTS(14, "购物返积分"),

    LUXURY_RECYCLE(15, "奢侈品回收"),


    GROUPON(16, "团购抵扣"),
    MALL_RETURN(20, "商城退还"),

    GROUPON_RETURN(21, "团购未成团退还"),
    SYSTEM_AWARD(30, "系统奖励"),
    SYSTEM_DEDUCT(31, "系统扣除"),
    ;

    private int value;
    private String desc;

    MemberPointsLogType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static MemberPointsLogType getByValue(int value) {
        for (MemberPointsLogType logType : MemberPointsLogType.values()) {
            if (logType.getValue() == value) {
                return logType;
            }
        }
        return null;
    }
}
